package com.ruoyi.project.service.impl;

import java.util.List;

import com.ruoyi.common.datascope.annotation.DataScope;
import com.ruoyi.project.domain.CxcyAchievement;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.project.mapper.CxcyAchievementMapper;
import com.ruoyi.project.service.ICxcyAchievementService;

/**
 * 成果信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-05-10
 */
@Service
public class CxcyAchievementServiceImpl implements ICxcyAchievementService 
{
    @Autowired
    private CxcyAchievementMapper cxcyAchievementMapper;

    /**
     * 查询成果信息
     * 
     * @param id 成果信息主键
     * @return 成果信息
     */
    @Override
    public CxcyAchievement selectCxcyAchievementById(Long id)
    {
        return cxcyAchievementMapper.selectCxcyAchievementById(id);
    }

    /**
     * 查询成果信息列表
     * 
     * @param cxcyAchievement 成果信息
     * @return 成果信息
     */
    @Override
    @DataScope(deptAlias = "cxcy_achievement", userAlias = "cxcy_achievement")
    public List<CxcyAchievement> selectCxcyAchievementList(CxcyAchievement cxcyAchievement)
    {
        return cxcyAchievementMapper.selectCxcyAchievementList(cxcyAchievement);
    }

    @Override
    public List<CxcyAchievement> selectCxcyAchievementListone(CxcyAchievement cxcyAchievement)
    {
        return cxcyAchievementMapper.selectCxcyAchievementListone(cxcyAchievement);
    }
    /**
     * 学生查询成果信息列表
     *
     * @param cxcyAchievement 成果信息
     * @return 成果信息
     */
    @Override
    public List<CxcyAchievement> selectStudentAchievementList(CxcyAchievement cxcyAchievement)
    {
        return cxcyAchievementMapper.selectStudentAchievementList(cxcyAchievement);
    }

    /**
     * 查询成果名称唯一信息列表
     *
     * @param cxcyAchievement 成果信息
     * @return 成果信息
     */
    @Override
    public List<CxcyAchievement> selectCxcyAchievementNameList(CxcyAchievement cxcyAchievement)
    {
        return cxcyAchievementMapper.selectCxcyAchievementNameList(cxcyAchievement);
    }

    /**
     * 新增成果信息
     * 
     * @param cxcyAchievement 成果信息
     * @return 结果
     */
    @Override
    public int insertCxcyAchievement(CxcyAchievement cxcyAchievement)
    {
        return cxcyAchievementMapper.insertCxcyAchievement(cxcyAchievement);
    }

    /**
     * 修改成果信息
     * 
     * @param cxcyAchievement 成果信息
     * @return 结果
     */
    @Override
    public int updateCxcyAchievement(CxcyAchievement cxcyAchievement)
    {
        return cxcyAchievementMapper.updateCxcyAchievement(cxcyAchievement);
    }

    /**
     * 批量删除成果信息
     * 
     * @param ids 需要删除的成果信息主键
     * @return 结果
     */
    @Override
    public int deleteCxcyAchievementByIds(Long[] ids)
    {
        return cxcyAchievementMapper.deleteCxcyAchievementByIds(ids);
    }

    /**
     * 删除成果信息信息
     * 
     * @param id 成果信息主键
     * @return 结果
     */
    @Override
    public int deleteCxcyAchievementById(Long id)
    {
        return cxcyAchievementMapper.deleteCxcyAchievementById(id);
    }

    @Override
    public List<CxcyAchievement> selectCxcyAchievementByUserId(Long userId) {
        return cxcyAchievementMapper.selectCxcyAchievementByUserId(userId);
    }

}
